package ReflectDemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2022-07-20
 * Time: 12:17
 */
class Student{
    public int id=12345;
    private String name="hua";
    private int age=12;

    @Override
    public String toString() {
        return "Student{id="+id+",name="+name+",age="+age+"}";
    }
    public void sleep(){
        System.out.println("I am a cat");
    }
    public Student(){
        System.out.println("Student()");
    }
    private Student(int id, String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }
    private void eat(String name){
        System.out.println(name+"吃鱼");
    }
}
public class Test {
    public static void main(String[] args) throws ClassNotFoundException {
        Student student=new Student();
        Class<?> c1=student.getClass();
        Class<?> c2=Student.class;
        Class<?> c3=Class.forName("ReflectDemo.Student");
        System.out.println(c1==c2);
        System.out.println(c1==c3);
        System.out.println(c2==c3);
    }
}
